package com.nami.ucenter.domain.model;

import lombok.Data;

import java.time.LocalDate;
import java.util.Date;

/**
 * 聚合根
 */
@Data
public class UserModel {

    /**
     * id
     */
    private Long id;

    /**
     * userId
     */
    private String userId;

    /**
     * 哪个应用的用户
     */
    private String appKey;

    /**
     * 微信openId
     */
    private String openId;

    /**
     * 真实姓名
     */
    private String realName;

    /**
     * 昵称
     */
    private String nickname;

    /**
     * 登录账号
     */
    private String account;

    /**
     * 用户认证信息-手机号
     */
    private String mobile;

    /**
     * 头像
     */
    private String avatarUrl;

    /**
     * 生日
     */
    private LocalDate birthday;

    /**
     * 密码
     */
    private String password;

    /**
     * 邮箱
     */
    private String email;

    /**
     * 身份证
     */
    private String idCard;

    /**
     * 性别 1 男, 2 女
     */
    private Integer gender;

    /**
     * 座右铭
     */
    private String motto;

    /**
     * 上次登录ip
     */
    private String lastLoginIp;

    /**
     * 上次登录时间
     */
    private Date lastLoginTime;

    /**
     * jwt 加解密盐
     */
    private String salt;

    /**
     * 加好友验证类型（Friend_AllowType） 1无需验证 2需要验证
     */
    private Integer friendValidateType;

    /**
     * 用户类型 10 普通， 20 客服， 30 机器人
     */
    private Integer userType;

    /**
     * 状态 10正常 20 系统封禁
     */
    private Integer status;


    private Date gmtCreate;

    private Date gmtModified;

    public UserModel() {
    }

    public UserModel(UserModel other) {
        if (other == null) {
            return;
        }
        this.id = other.id;
        this.userId = other.userId;
        this.appKey = other.appKey;
        this.openId = other.openId;
        this.realName = other.realName;
        this.nickname = other.nickname;
        this.account = other.account;
        this.mobile = other.mobile;
        this.avatarUrl = other.avatarUrl;
        this.birthday = other.birthday;
        this.password = other.password;
        this.email = other.email;
        this.idCard = other.idCard;
        this.gender = other.gender;
        this.motto = other.motto;
        this.lastLoginIp = other.lastLoginIp;
        this.lastLoginTime = other.lastLoginTime;
        this.salt = other.salt;
        this.friendValidateType = other.friendValidateType;
        this.userType = other.userType;
        this.status = other.status;
        this.gmtCreate = other.gmtCreate;
        this.gmtModified = other.gmtModified;

    }

    public UserModel clone() {
        return new UserModel(this);
    }


}
